package com.icedbrew.appfuel.persistence.dao;

import com.icedbrew.appfuel.DatabaseException;
import com.icedbrew.appfuel.persistence.entity.BaseEntity;

import java.util.List;

/**
 * Generic DAO Interface
 *
 * @param <E>
 *      The Entity type
 * @author  arjay.nacion
 * @since   1.0
 */
public interface IDao<E extends BaseEntity> {

    void addOrUpdate(E entity) throws DatabaseException;

    void delete(E entity) throws DatabaseException;

    void deleteById(Long id) throws DatabaseException;

    E findById(Long id) throws DatabaseException;

    List<E> findAll() throws DatabaseException;

    List<E> findBatch(int start, int size) throws DatabaseException;

    Long countAll() throws DatabaseException;
}
